cmake_minimum_required(VERSION 3.5)
project(framelesshelper)

set(FRAMELESSHELPER_DEMO_NAME Demo_FramelessHelper)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED)

set(PROJECT_SOURCES
    mainwindow.h
    mainwindow.cpp
    main.cpp
)

add_executable(${FRAMELESSHELPER_DEMO_NAME}
    ${PROJECT_SOURCES}
)

target_link_libraries(${FRAMELESSHELPER_DEMO_NAME} PUBLIC
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::Widgets
)

set(QX_FRAMELESS_LIB_NAME qxframeless${QX_FRAMELESS_VERSION_MAJOR})
target_link_libraries(${FRAMELESSHELPER_DEMO_NAME} PRIVATE "${QX_FRAMELESS_LIB_NAME}")

set_target_properties(${FRAMELESSHELPER_DEMO_NAME} PROPERTIES
    AUTOMOC ON
    AUTORCC ON
    AUTOUIC ON
    CXX_EXTENSIONS OFF
    EXPORT_NAME ${FRAMELESSHELPER_DEMO_NAME}
    ARCHIVE_OUTPUT_DIRECTORY "${QX_FRAMELESS_BIN_DIR}/lib"
    LIBRARY_OUTPUT_DIRECTORY "${QX_FRAMELESS_BIN_DIR}/lib"
    RUNTIME_OUTPUT_DIRECTORY "${QX_FRAMELESS_BIN_DIR}/bin"
)
